package com.zyong.design.pattern.visitor.case2;

import java.util.List;
import java.util.ArrayList;

/**
 * @program: zyong-design-pattern
 * @ClassName: ObjectStructure
 * @author: zyong
 * @create: 2024-03-29 00:24
 */
public class ObjectStructure {
    private List<Person> persons = new ArrayList<Person>();

    public void addPerson(Person person) {
        persons.add(person);
    }

    public void removePerson(Person person) {
        persons.remove(person);
    }

    public void evaluationResults(SingerPerformance singerPerformance) {
        for (Person person : persons) {
            person.accept(singerPerformance);
        }
    }
}
